"""
wx 配置读取
"""
import os
import configparser


class ConfigParser:

    def __init__(self):
        self.config_path = os.path.join(os.path.dirname(__file__), "config.ini")
        self.conf = configparser.ConfigParser()
        self.conf.read(self.config_path, encoding="utf-8")

    def get_url(self):
        """
        获取请求地址
        """
        return self.conf.get("fdd", "url")

    def get_app_secret(self):
        """
        获取 app_secret
        """
        return self.conf.get("fdd", "app_secret")

    def get_app_id(self):
        """
        获取 app_id
        """
        return self.conf.get("fdd", "app_id")

    def get_mch_id(self):
        """
        获取商户id
        """
        return self.conf.get("fdd", "mchid")

    def get_version(self):
        """
        获取 版本
        """
        return self.conf.get("fdd", "version")

    def get_notify_url(self):
        """
        获取回调地址
        """
        return self.conf.get("fdd", "notify_url")

    def get_return_url(self):
        """
        认证结束 返回地址
        """
        return self.conf.get("fdd", "return_url")
